<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var value = (a, b, fn) => fn(a, b);
        var add = (a, b) => a + b;
        var sub = (a, b) => a - b;
        console.log(value(1, 2, add));
        console.log(value(2, 1, sub));
    </script>
</head>

<body>

</body>

</html>